//
//  STDiscoverFooterView.swift
//  STMusic
//
//  Created by stoneobs on 16/10/25.
//  Copyright © 2016年 stoneobs. All rights reserved.
// 首页的footerview，没有播放器，就隐藏，写个协议，封装出去  120

import UIKit

class STDiscoverFooterView: UICollectionReusableView {
    var whiteBack:UIView!
    //这个是footer播放器上的控件
    var musicIconButton:STButton!
    var musicTitleButton:STButton!
    var musicNumButton:STButton!    //
    var musicPlayButton:STButton!  //播放按钮
    
    //评论，赞，转发
    var commentButton:STButton!
    var likeButton:STButton!
    var shareButton:STButton!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        initSubview()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    func initSubview() {
        self.backgroundColor = .white;
        let grayBack = UIView.init(frame: .init(x: 15, y: 5, width: SCREEN_WIDTH - 30 - 14, height: 50));
        grayBack.backgroundColor = BACKROUND_COLOR;
        self.addSubview(grayBack);
        
        self.musicIconButton = STButton.init(frame: .init(x: 0, y: 0, width: 50, height: 50), title: nil, titleColor: nil, titleFont: 0, cornerRadius: 0, backgroundColor: nil, backgroundImage: UIImage.init(named: "1"), image: nil);
        grayBack.addSubview(self.musicIconButton);
        
        self.musicTitleButton = STButton.init(frame: .init(x: self.musicIconButton.right+3, y: 0, width: grayBack.width - 100, height: 25), title: "JAsss||十周年 故事之旅", titleColor: SecendTextColor, titleFont: 13, cornerRadius: 0, backgroundColor: .clear, backgroundImage: nil, image: nil)
        self.musicTitleButton.contentHorizontalAlignment = .left;
        grayBack.addSubview(self.musicTitleButton);
        
        self.musicNumButton = STButton.init(frame: .init(x: self.musicIconButton.right+3, y: 25, width: grayBack.width - 100, height: 25), title: "播放：199999次   ", titleColor: ThirdTextColor, titleFont: 13, cornerRadius: 0, backgroundColor: .clear, backgroundImage: nil, image: nil)
         self.musicNumButton.contentHorizontalAlignment = .left;
        grayBack.addSubview(self.musicNumButton);
        
        self.musicPlayButton = STButton.init(frame: .init(x: grayBack.width - 30, y: 25, width: 25, height: 25), title: "", titleColor: ThirdTextColor, titleFont: 0, cornerRadius: 12.5, backgroundColor: .clear, backgroundImage: UIImage.init(named: "message_icon3"), image: nil)
        self.musicPlayButton.centerY = 25;
        grayBack.addSubview(self.musicPlayButton);
        
        let line = UIView.init(frame: .init(x: 0, y: grayBack.bottom+10, width: self.width, height: 0.3));
        line.backgroundColor = UIColor.gray.withAlphaComponent(0.5)
        self.addSubview(line);
        //collect_image_normal
        self.commentButton = STButton.init(frame: .init(x: 0, y: line.bottom, width: self.width/3, height: 30), title: "10", titleColor: SecendTextColor, titleFont: 11, cornerRadius: 0, backgroundColor: .white, backgroundImage: nil, image: UIImage.init(named: "about_us_share"));
        self.commentButton.showRightLine(30);
        self.commentButton.titleEdgeInsets = .init(top: 0, left: 2, bottom: 0, right: 0);
        self.addSubview(self.commentButton);
        
        self.likeButton = STButton.init(frame: .init(x: self.width/3, y: line.bottom, width: self.width/3, height: 30), title: "10", titleColor: SecendTextColor, titleFont: 11, cornerRadius: 0, backgroundColor: .white, backgroundImage: nil, image: UIImage.init(named: "collect_image_normal"));
        self.likeButton.showRightLine(30);
        self.likeButton.titleEdgeInsets = .init(top: 0, left: 2, bottom: 0, right: 0);
        self.addSubview(self.likeButton);
        
        self.shareButton = STButton.init(frame: .init(x: 2*self.width/3, y: line.bottom, width: self.width/3, height: 30), title: "10", titleColor: SecendTextColor, titleFont: 11, cornerRadius: 0, backgroundColor: .white, backgroundImage: nil, image: UIImage.init(named: "about_us_share"));
        self.shareButton.titleEdgeInsets = .init(top: 0, left: 2, bottom: 0, right: 0);
        self.addSubview(self.shareButton);
        
        
        
        
        
    }
}
